#include "someip/SomeIPManager.h"
#include "serialize/Deserializer.h"
#include "serialize/Serializer.h"
#include <transfer/utils.h>

namespace ecarx::transfer{


SettingDrivingInfo SomeIPManager::getSettingDrivingInfoInf(){
    dra::com::Deserializer des;
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::SettingDrivingInfoInfEventId));
    }
    SettingDrivingInfo data;
    if (value.has_value()){
        des.setDeserialDataAddr(value->value.bytes.data(), value->value.bytes.size());
        if (!dra::com::deserialize(&des, data)) {
            printf("deserialize SettingDrivingInfo failure\n");
        }
    }
    return data;
}

bool SomeIPManager::setSettingDrivingInfoInf(const SettingDrivingInfo&  value){
    dra::com::Serializer ser;
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::SettingDrivingInfoInfSetterId);
    if (dra::com::serialize(&ser, value)) {
        signal.value.bytes = ser.getSerialContent();
    }
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

SettingAEBInfo SomeIPManager::getSettingAEBInfoInf(){
    dra::com::Deserializer des;
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::SettingAEBInfoInfEventId));
    }
    SettingAEBInfo data;
    if (value.has_value()){
        des.setDeserialDataAddr(value->value.bytes.data(), value->value.bytes.size());
        if (!dra::com::deserialize(&des, data)) {
            printf("deserialize SettingAEBInfo failure\n");
        }
    }
    return data;
}

bool SomeIPManager::setSettingAEBInfoInf(const SettingAEBInfo&  value){
    dra::com::Serializer ser;
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::SettingAEBInfoInfSetterId);
    if (dra::com::serialize(&ser, value)) {
        signal.value.bytes = ser.getSerialContent();
    }
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

SettingLKAInfo SomeIPManager::getSettingLKAInfoInf(){
    dra::com::Deserializer des;
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::SettingLKAInfoInfEventId));
    }
    SettingLKAInfo data;
    if (value.has_value()){
        des.setDeserialDataAddr(value->value.bytes.data(), value->value.bytes.size());
        if (!dra::com::deserialize(&des, data)) {
            printf("deserialize SettingLKAInfo failure\n");
        }
    }
    return data;
}

bool SomeIPManager::setSettingLKAInfoInf(const SettingLKAInfo&  value){
    dra::com::Serializer ser;
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::SettingLKAInfoInfSetterId);
    if (dra::com::serialize(&ser, value)) {
        signal.value.bytes = ser.getSerialContent();
    }
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

SettingFCTAInfo SomeIPManager::getSettingFCTAInfoInf(){
    dra::com::Deserializer des;
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::SettingFCTAInfoInfEventId));
    }
    SettingFCTAInfo data;
    if (value.has_value()){
        des.setDeserialDataAddr(value->value.bytes.data(), value->value.bytes.size());
        if (!dra::com::deserialize(&des, data)) {
            printf("deserialize SettingFCTAInfo failure\n");
        }
    }
    return data;
}

bool SomeIPManager::setSettingFCTAInfoInf(const SettingFCTAInfo&  value){
    dra::com::Serializer ser;
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::SettingFCTAInfoInfSetterId);
    if (dra::com::serialize(&ser, value)) {
        signal.value.bytes = ser.getSerialContent();
    }
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

int8_t SomeIPManager::getSettingRCTAInfoInf(){
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::SettingRCTAInfoInfEventId));
    }
    if (value.has_value()){
        return static_cast<int8_t>(value->value.int32Values[0]);
    }

    return {};
}

bool SomeIPManager::setSettingRCTAInfoInf(const int8_t value){
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::SettingRCTAInfoInfSetterId);
    signal.value.int32Values={(int32_t)value};
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

int8_t SomeIPManager::getSettingDOWInfoInf(){
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::SettingDOWInfoInfEventId));
    }
    if (value.has_value()){
        return static_cast<int8_t>(value->value.int32Values[0]);
    }

    return {};
}

bool SomeIPManager::setSettingDOWInfoInf(const int8_t value){
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::SettingDOWInfoInfSetterId);
    signal.value.int32Values={(int32_t)value};
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

SettingBSDInfo SomeIPManager::getSettingBSDInfoInf(){
    dra::com::Deserializer des;
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::SettingBSDInfoInfEventId));
    }
    SettingBSDInfo data;
    if (value.has_value()){
        des.setDeserialDataAddr(value->value.bytes.data(), value->value.bytes.size());
        if (!dra::com::deserialize(&des, data)) {
            printf("deserialize SettingBSDInfo failure\n");
        }
    }
    return data;
}

bool SomeIPManager::setSettingBSDInfoInf(const SettingBSDInfo&  value){
    dra::com::Serializer ser;
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::SettingBSDInfoInfSetterId);
    if (dra::com::serialize(&ser, value)) {
        signal.value.bytes = ser.getSerialContent();
    }
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

SettingTSIInfo SomeIPManager::getSettingTSIInfoInf(){
    dra::com::Deserializer des;
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::SettingTSIInfoInfEventId));
    }
    SettingTSIInfo data;
    if (value.has_value()){
        des.setDeserialDataAddr(value->value.bytes.data(), value->value.bytes.size());
        if (!dra::com::deserialize(&des, data)) {
            printf("deserialize SettingTSIInfo failure\n");
        }
    }
    return data;
}

bool SomeIPManager::setSettingTSIInfoInf(const SettingTSIInfo&  value){
    dra::com::Serializer ser;
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::SettingTSIInfoInfSetterId);
    if (dra::com::serialize(&ser, value)) {
        signal.value.bytes = ser.getSerialContent();
    }
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

int8_t SomeIPManager::getSettingSRVInfoInf(){
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::SettingSRVInfoInfEventId));
    }
    if (value.has_value()){
        return static_cast<int8_t>(value->value.int32Values[0]);
    }

    return {};
}

bool SomeIPManager::setSettingSRVInfoInf(const int8_t value){
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::SettingSRVInfoInfSetterId);
    signal.value.int32Values={(int32_t)value};
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

int8_t SomeIPManager::getSettingEMAInfoInf(){
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::SettingEMAInfoInfEventId));
    }
    if (value.has_value()){
        return static_cast<int8_t>(value->value.int32Values[0]);
    }

    return {};
}

bool SomeIPManager::setSettingEMAInfoInf(const int8_t value){
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::SettingEMAInfoInfSetterId);
    signal.value.int32Values={(int32_t)value};
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

SettingTLAInfo SomeIPManager::getSettingTLAInfoInf(){
    dra::com::Deserializer des;
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::SettingTLAInfoInfEventId));
    }
    SettingTLAInfo data;
    if (value.has_value()){
        des.setDeserialDataAddr(value->value.bytes.data(), value->value.bytes.size());
        if (!dra::com::deserialize(&des, data)) {
            printf("deserialize SettingTLAInfo failure\n");
        }
    }
    return data;
}

bool SomeIPManager::setSettingTLAInfoInf(const SettingTLAInfo&  value){
    dra::com::Serializer ser;
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::SettingTLAInfoInfSetterId);
    if (dra::com::serialize(&ser, value)) {
        signal.value.bytes = ser.getSerialContent();
    }
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

int8_t SomeIPManager::getSettingCMSRInfoInf(){
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::SettingCMSRInfoInfEventId));
    }
    if (value.has_value()){
        return static_cast<int8_t>(value->value.int32Values[0]);
    }

    return {};
}

bool SomeIPManager::setSettingCMSRInfoInf(const int8_t value){
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::SettingCMSRInfoInfSetterId);
    signal.value.int32Values={(int32_t)value};
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

int8_t SomeIPManager::getSettingVoiceWarningInfoInf(){
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::SettingVoiceWarningInfoInfEventId));
    }
    if (value.has_value()){
        return static_cast<int8_t>(value->value.int32Values[0]);
    }

    return {};
}

bool SomeIPManager::setSettingVoiceWarningInfoInf(const int8_t value){
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::SettingVoiceWarningInfoInfSetterId);
    signal.value.int32Values={(int32_t)value};
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

int8_t SomeIPManager::getSettingAPAInfoInf(){
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::SettingAPAInfoInfEventId));
    }
    if (value.has_value()){
        return static_cast<int8_t>(value->value.int32Values[0]);
    }

    return {};
}

bool SomeIPManager::setSettingAPAInfoInf(const int8_t value){
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::SettingAPAInfoInfSetterId);
    signal.value.int32Values={(int32_t)value};
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

SettingRPAInfo SomeIPManager::getSettingRPAInfoInf(){
    dra::com::Deserializer des;
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::SettingRPAInfoInfEventId));
    }
    SettingRPAInfo data;
    if (value.has_value()){
        des.setDeserialDataAddr(value->value.bytes.data(), value->value.bytes.size());
        if (!dra::com::deserialize(&des, data)) {
            printf("deserialize SettingRPAInfo failure\n");
        }
    }
    return data;
}

bool SomeIPManager::setSettingRPAInfoInf(const SettingRPAInfo&  value){
    dra::com::Serializer ser;
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::SettingRPAInfoInfSetterId);
    if (dra::com::serialize(&ser, value)) {
        signal.value.bytes = ser.getSerialContent();
    }
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

int8_t SomeIPManager::getSettingLPInfoInf(){
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::SettingLPInfoInfEventId));
    }
    if (value.has_value()){
        return static_cast<int8_t>(value->value.int32Values[0]);
    }

    return {};
}

bool SomeIPManager::setSettingLPInfoInf(const int8_t value){
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::SettingLPInfoInfSetterId);
    signal.value.int32Values={(int32_t)value};
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

int32_t SomeIPManager::getSelectedSlotIdInf(){
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::SelectedSlotIdInfEventId));
    }
    if (value.has_value()){
        return static_cast<int32_t>(value->value.int32Values[0]);
    }

    return {};
}

bool SomeIPManager::setSelectedSlotIdInf(const int32_t value){
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::SelectedSlotIdInfSetterId);
    signal.value.int32Values={(int32_t)value};
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

bool SomeIPManager::setSpeedLimitTriggerInf(const int8_t value){
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::SpeedLimitTriggerInfMethodId);
    signal.value.int32Values={(int32_t)value};
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

bool SomeIPManager::setNavExitTriggerInf(const int8_t value){
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::NavExitTriggerInfMethodId);
    signal.value.int32Values={(int32_t)value};
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

bool SomeIPManager::setNzpStateTriggerInf(const int8_t value){
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::NzpStateTriggerInfMethodId);
    signal.value.int32Values={(int32_t)value};
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

bool SomeIPManager::setCustomParkingInf(const CustomParking&  value){
    dra::com::Serializer ser;
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::CustomParkingInfMethodId);
    if (dra::com::serialize(&ser, value)) {
        signal.value.bytes = ser.getSerialContent();
    }
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

bool SomeIPManager::setNavigationInfoInf(const NavigationInfo&  value){
    dra::com::Serializer ser;
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::NavigationInfoInfMethodId);
    if (dra::com::serialize(&ser, value)) {
        signal.value.bytes = ser.getSerialContent();
    }
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

AlarmInfo SomeIPManager::getAlarmInfoInf(){
    dra::com::Deserializer des;
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::AlarmInfoInfEventId));
    }
    AlarmInfo data;
    if (value.has_value()){
        des.setDeserialDataAddr(value->value.bytes.data(), value->value.bytes.size());
        if (!dra::com::deserialize(&des, data)) {
            printf("deserialize AlarmInfo failure\n");
        }
    }
    return data;
}

std::vector<ID32bit> SomeIPManager::getFaultListInfoInf(){
    dra::com::Deserializer des;
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::FaultListInfoInfEventId));
    }
    std::vector<ID32bit> data{};
    if (value.has_value()){
        des.setDeserialDataAddr(value->value.bytes.data(), value->value.bytes.size());
        if (!dra::com::deserialize(&des, data)) {
            printf("deserialize ID32bit vector failure\n");
        }
    }
    return data;
}

FeatureState SomeIPManager::getFeatureStateInf(){
    dra::com::Deserializer des;
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::FeatureStateInfEventId));
    }
    FeatureState data;
    if (value.has_value()){
        des.setDeserialDataAddr(value->value.bytes.data(), value->value.bytes.size());
        if (!dra::com::deserialize(&des, data)) {
            printf("deserialize FeatureState failure\n");
        }
    }
    return data;
}

HighDefinitionMap SomeIPManager::getHighDefinitionMapInf(){
    dra::com::Deserializer des;
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::HighDefinitionMapInfEventId));
    }
    HighDefinitionMap data;
    if (value.has_value()){
        des.setDeserialDataAddr(value->value.bytes.data(), value->value.bytes.size());
        if (!dra::com::deserialize(&des, data)) {
            printf("deserialize HighDefinitionMap failure\n");
        }
    }
    return data;
}

std::vector<Object> SomeIPManager::getPercepFusionObjsInf(){
    dra::com::Deserializer des;
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::PercepFusionObjsInfEventId));
    }
    std::vector<Object> data{};
    if (value.has_value()){
        des.setDeserialDataAddr(value->value.bytes.data(), value->value.bytes.size());
        if (!dra::com::deserialize(&des, data)) {
            printf("deserialize Object vector failure\n");
        }
    }
    return data;
}

std::vector<APASlot> SomeIPManager::getPerceptionAPASlotsInf(){
    dra::com::Deserializer des;
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::PerceptionAPASlotsInfEventId));
    }
    std::vector<APASlot> data{};
    if (value.has_value()){
        des.setDeserialDataAddr(value->value.bytes.data(), value->value.bytes.size());
        if (!dra::com::deserialize(&des, data)) {
            printf("deserialize APASlot vector failure\n");
        }
    }
    return data;
}

std::vector<TrafficLight> SomeIPManager::getPercepTrafficLightsInf(){
    dra::com::Deserializer des;
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::PercepTrafficLightsInfEventId));
    }
    std::vector<TrafficLight> data{};
    if (value.has_value()){
        des.setDeserialDataAddr(value->value.bytes.data(), value->value.bytes.size());
        if (!dra::com::deserialize(&des, data)) {
            printf("deserialize TrafficLight vector failure\n");
        }
    }
    return data;
}

PlanningTrajectory SomeIPManager::getPlanningTrajectoryInf(){
    dra::com::Deserializer des;
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::PlanningTrajectoryInfEventId));
    }
    PlanningTrajectory data;
    if (value.has_value()){
        des.setDeserialDataAddr(value->value.bytes.data(), value->value.bytes.size());
        if (!dra::com::deserialize(&des, data)) {
            printf("deserialize PlanningTrajectory failure\n");
        }
    }
    return data;
}

RelativeLocalization SomeIPManager::getRelativeLocalizationInf(){
    dra::com::Deserializer des;
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::RelativeLocalizationInfEventId));
    }
    RelativeLocalization data;
    if (value.has_value()){
        des.setDeserialDataAddr(value->value.bytes.data(), value->value.bytes.size());
        if (!dra::com::deserialize(&des, data)) {
            printf("deserialize RelativeLocalization failure\n");
        }
    }
    return data;
}

int8_t SomeIPManager::getAlignedSpeedSettingInf(){
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::AlignedSpeedSettingInfEventId));
    }
    if (value.has_value()){
        return static_cast<int8_t>(value->value.int32Values[0]);
    }

    return {};
}

bool SomeIPManager::setAlignedSpeedSettingInf(const int8_t value){
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::AlignedSpeedSettingInfSetterId);
    signal.value.int32Values={(int32_t)value};
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

int8_t SomeIPManager::getPebSwitchSettingInf(){
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::PebSwitchSettingInfEventId));
    }
    if (value.has_value()){
        return static_cast<int8_t>(value->value.int32Values[0]);
    }

    return {};
}

bool SomeIPManager::setPebSwitchSettingInf(const int8_t value){
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::PebSwitchSettingInfSetterId);
    signal.value.int32Values={(int32_t)value};
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

bool SomeIPManager::setOnlineCalibTriggerInf(const IdtOnlineCalibTrigger&  value){
    dra::com::Serializer ser;
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::OnlineCalibTriggerInfMethodId);
    if (dra::com::serialize(&ser, value)) {
        signal.value.bytes = ser.getSerialContent();
    }
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

std::vector<EnvRoadLaneLine> SomeIPManager::getLaneFunction(){
    dra::com::Deserializer des;
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::LaneFunctionEventId));
    }
    std::vector<EnvRoadLaneLine> data{};
    if (value.has_value()){
        des.setDeserialDataAddr(value->value.bytes.data(), value->value.bytes.size());
        if (!dra::com::deserialize(&des, data)) {
            printf("deserialize EnvRoadLaneLine vector failure\n");
        }
    }
    return data;
}

bool SomeIPManager::setLaneFunction(const std::vector<EnvRoadLaneLine>& array){
    dra::com::Serializer ser;
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::LaneFunctionSetterId);
    if (dra::com::serialize(&ser, array)) {
        signal.value.bytes = ser.getSerialContent();
    }
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

AbsoluteLocalization SomeIPManager::getAbsoluteLocalizationInf(){
    dra::com::Deserializer des;
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::AbsoluteLocalizationInfEventId));
    }
    AbsoluteLocalization data;
    if (value.has_value()){
        des.setDeserialDataAddr(value->value.bytes.data(), value->value.bytes.size());
        if (!dra::com::deserialize(&des, data)) {
            printf("deserialize AbsoluteLocalization failure\n");
        }
    }
    return data;
}

bool SomeIPManager::setAbsoluteLocalizationInf(const AbsoluteLocalization&  value){
    dra::com::Serializer ser;
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::AbsoluteLocalizationInfSetterId);
    if (dra::com::serialize(&ser, value)) {
        signal.value.bytes = ser.getSerialContent();
    }
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

bool SomeIPManager::setDHUInquireIssueLogInf(const IdtDHUInquireIssueLog&  value){
    dra::com::Serializer ser;
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::DHUInquireIssueLogInfMethodId);
    if (dra::com::serialize(&ser, value)) {
        signal.value.bytes = ser.getSerialContent();
    }
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

bool SomeIPManager::setSettingInitializationInf(const IdtSettingInitialization&  value){
    dra::com::Serializer ser;
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::SettingInitializationInfMethodId);
    if (dra::com::serialize(&ser, value)) {
        signal.value.bytes = ser.getSerialContent();
    }
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

int8_t SomeIPManager::getSettingSGWInfoInf(){
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::SettingSGWInfoInfEventId));
    }
    if (value.has_value()){
        return static_cast<int8_t>(value->value.int32Values[0]);
    }

    return {};
}

bool SomeIPManager::setSettingSGWInfoInf(const int8_t value){
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::SettingSGWInfoInfSetterId);
    signal.value.int32Values={(int32_t)value};
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

IdtSettingInfo SomeIPManager::getSettingCheckInf(){
    dra::com::Deserializer des;
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::SettingCheckInfEventId));
    }
    IdtSettingInfo data;
    if (value.has_value()){
        des.setDeserialDataAddr(value->value.bytes.data(), value->value.bytes.size());
        if (!dra::com::deserialize(&des, data)) {
            printf("deserialize IdtSettingInfo failure\n");
        }
    }
    return data;
}

bool SomeIPManager::setSettingCheckReq(const IdtSettingCheck&  value){
    dra::com::Serializer ser;
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::SettingCheckReqMethodId);
    if (dra::com::serialize(&ser, value)) {
        signal.value.bytes = ser.getSerialContent();
    }
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

bool SomeIPManager::setNavigationStsInf(const int8_t value){
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::NavigationStsInfMethodId);
    signal.value.int32Values={(int32_t)value};
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

int8_t SomeIPManager::getAPAnobtntriSwitchInf(){
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::APAnobtntriSwitchInfEventId));
    }
    if (value.has_value()){
        return static_cast<int8_t>(value->value.int32Values[0]);
    }

    return {};
}

bool SomeIPManager::setAPAnobtntriSwitchInf(const int8_t value){
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::APAnobtntriSwitchInfSetterId);
    signal.value.int32Values={(int32_t)value};
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

int8_t SomeIPManager::getSettingRCTBInfoInf(){
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::SettingRCTBInfoInfEventId));
    }
    if (value.has_value()){
        return static_cast<int8_t>(value->value.int32Values[0]);
    }

    return {};
}

bool SomeIPManager::setSettingRCTBInfoInf(const int8_t value){
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::SettingRCTBInfoInfSetterId);
    signal.value.int32Values={(int32_t)value};
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

int8_t SomeIPManager::getAccfushSwitchType(){
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::AccfushSwitchTypeEventId));
    }
    if (value.has_value()){
        return static_cast<int8_t>(value->value.int32Values[0]);
    }

    return {};
}

bool SomeIPManager::setAccfushSwitchType(const int8_t value){
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::AccfushSwitchTypeSetterId);
    signal.value.int32Values={(int32_t)value};
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

int32_t SomeIPManager::getALCAstateInf(){
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::ALCAstateInfEventId));
    }
    if (value.has_value()){
        return static_cast<int32_t>(value->value.int32Values[0]);
    }

    return {};
}

int8_t SomeIPManager::getDispTSIInfoForLgtCtrlSeN(){
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::DispTSIInfoForLgtCtrlSeNEventId));
    }
    if (value.has_value()){
        return static_cast<int8_t>(value->value.int32Values[0]);
    }

    return {};
}

bool SomeIPManager::setDispTSIInfoForLgtCtrlSeN(const int8_t value){
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::DispTSIInfoForLgtCtrlSeNSetterId);
    signal.value.int32Values={(int32_t)value};
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

int32_t SomeIPManager::getTSISpeedLimitUnitIconSeN(){
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::TSISpeedLimitUnitIconSeNEventId));
    }
    if (value.has_value()){
        return static_cast<int32_t>(value->value.int32Values[0]);
    }

    return {};
}

APAparkInfo SomeIPManager::getAPAparkinfoInf(){
    dra::com::Deserializer des;
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::APAparkinfoInfEventId));
    }
    APAparkInfo data;
    if (value.has_value()){
        des.setDeserialDataAddr(value->value.bytes.data(), value->value.bytes.size());
        if (!dra::com::deserialize(&des, data)) {
            printf("deserialize APAparkInfo failure\n");
        }
    }
    return data;
}

bool SomeIPManager::setAPAparkinfoInf(const APAparkInfo&  value){
    dra::com::Serializer ser;
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::APAparkinfoInfSetterId);
    if (dra::com::serialize(&ser, value)) {
        signal.value.bytes = ser.getSerialContent();
    }
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

int8_t SomeIPManager::getBigdataSpdLimSwitchInf(){
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::BigdataSpdLimSwitchInfEventId));
    }
    if (value.has_value()){
        return static_cast<int8_t>(value->value.int32Values[0]);
    }

    return {};
}

bool SomeIPManager::setBigdataSpdLimSwitchInf(const int8_t value){
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::BigdataSpdLimSwitchInfSetterId);
    signal.value.int32Values={(int32_t)value};
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

SettingAEBFCWInfo SomeIPManager::getSettingAEBFCWInfoInf(){
    dra::com::Deserializer des;
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::SettingAEBFCWInfoInfEventId));
    }
    SettingAEBFCWInfo data;
    if (value.has_value()){
        des.setDeserialDataAddr(value->value.bytes.data(), value->value.bytes.size());
        if (!dra::com::deserialize(&des, data)) {
            printf("deserialize SettingAEBFCWInfo failure\n");
        }
    }
    return data;
}

bool SomeIPManager::setSettingAEBFCWInfoInf(const SettingAEBFCWInfo&  value){
    dra::com::Serializer ser;
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::SettingAEBFCWInfoInfSetterId);
    if (dra::com::serialize(&ser, value)) {
        signal.value.bytes = ser.getSerialContent();
    }
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

int32_t SomeIPManager::getSettingRCTABInfoInf(){
    std::optional<Signal> value;
    if(mSomeIPConn != nullptr){
        value=mSomeIPConn->read(static_cast<int32_t>(SOMEIPRX::SettingRCTABInfoInfEventId));
    }
    if (value.has_value()){
        return static_cast<int32_t>(value->value.int32Values[0]);
    }

    return {};
}

bool SomeIPManager::setSettingRCTABInfoInf(const int32_t value){
    Signal signal;
    signal.signalId=static_cast<uint32_t>(SOMEIPTX::SettingRCTABInfoInfSetterId);
    signal.value.int32Values={(int32_t)value};
    if(mSomeIPConn != nullptr){
        return mSomeIPConn->write(signal);
    }
    return false;
}

}
